<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<base href="__ROOT__/" />
	<title>京东(JD.COM)-综合网购首选-正品低价、品质保障、配送及时、轻松购物！</title>
	<link rel="stylesheet" href="__PUBLIC__/css/bootstrap.min.css">
	<link rel="stylesheet" href="__PUBLIC__/css/bootstrap-theme.min.css">
	<link rel="stylesheet" href="__PUBLIC__/css/front.css">
	<link rel="stylesheet" href="__PUBLIC__/css/nivo-slider.css">
	
</head>
<body id="product_lists">
	<div class="container">
		<include file="./Application/Home/View/header.php" />
		<br /><br />
		<div class="row">
			<div class="col-sm-3">
				<div id="product_menu">
					<div id="product_menu_title">
						<a href="#" class="navbar-link"><i class="glyphicon glyphicon-menu-hamburger"></i><?=$parent_catalog['name']?></a>
					</div>
					<ul>
					<?php foreach($brother_catalogs as $c){?>
						<li <?php if($c['id'] == $catalog['id']){?> class="active" <?php }?>><a href="<?=U('Home/product/lists/',array('cataid'=>$c['id']))?>"><?=$c['name']?></a></li>
						<?php }?>
					</ul>
				</div>
			</div>
			<div class="col-sm-9">
				<div class="row">
					<div id="brands" class="col-md-12">
						<?php foreach($brands as $b){?>
							<a <?php if($b['id'] == $brand_id['id']){?> class="active" <?php }?> href="<?php echo U()."/cataid/".$catalog['id']."?brand=". $b['id']?>"><?=$b['name']?></a>
						<?php }?>
					</div>
				</div>
				<div class="row">
					<?php foreach($products as $p){?>
						<div class="col-md-3 product_item">
							<img class="product_item_img" src="__ROOT__<?=$p['img']?>">
							<?php $imgs = M('product_img')->where('product_id ='.$p['id'])->limit(4)->select();?>
							<ul class="clearfix">
								<?php foreach($imgs as $img){?>
								<li><img src="__ROOT__<?=$img['url']?>"></li>
								<?php }?>
							</ul>
							<h5><a href="<?=U('home/product/detail/',array('id'=>$p['id']))?>"><?=$p['title']?></a></h5>
							<p class="price">¥<?=$p['price']?></p>
							<a href="<?=U('home/product/detail/',array('id'=>$p['id']))?>" class="btn btn-danger">立即购买</a>
						</div>
					<?php }?>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript" src="__PUBLIC__/js/jquery-3.1.0.min.js"></script>
	<script type="text/javascript">
	    $(function(){
		    $('.product_item ul li').mouseover(function(){
		    	$(this).parents('.product_item').find('ul li').removeClass("hover");
		    	$(this).addClass('hover');  
		    	var src = $(this).find('img').attr('src');
		    	$(this).parents('.product_item').find('.product_item_img').attr('src',src);	
		    })
		});
	</script>
</body>
</html>